/*
 * @FilePath: /cpp_study/ch05/forstr2.cpp
 * @Description: 逗号运运算符
 * @Author: dengrunting
 * @Date: 2022-01-07 18:46:02
 * @LastEditTime: 2022-01-07 18:52:04
 */

#include<iostream>
#include<string>
int main(){

    using namespace std;
    cout << "Enter a word: ";
    string word;
    cin >> word;

    char temp;
    int i,j;
    for(j=0, i = word.size() - 1; j < i; --i, ++j){
        temp = word[i];
        word[i] = word[j];
        word[j] = temp;
    }
    cout << word << "\nDone.\n";
    return 0;
}